<template>
  <div class="pay-done">
    <BaseHeader></BaseHeader>
    <div class="pay-done-box">
      <img src="../../assets/images/pay-success.png" />
    </div>
    <div class="pay-btn">
      <Button type="primary" @click="$router.push('/market')"
        >继续逛逛</Button
      >
      <Button
        type="info"
        v-if="$route.query.orderType === 'RECHARGE'"
        @click="$router.push('/home/MoneyManagement')"
        >查看余额</Button
      >
      <Button type="info" v-else @click="$router.push('/home/myOrder')"
        >查看订单</Button
      >
    </div>
  </div>
</template>

<script>
import * as apiLogin from "@/api/login.js";
import storage from "@/plugins/storage.js";
export default {
  
  name: "PayDone",
  mounted() {
    document.querySelector(".pay-done").style.height =
      window.innerHeight + "px";
  },
  created() {
    //更新用户信息
    apiLogin.getMemberMsg().then((res) => {
      if (res.success) {
        console.log(res.result,'res.result');
        storage.setItem("userInfo", res.result);
        localStorage.setItem("userInfo", JSON.stringify(res.result));
      }
    });
  },
};
</script>

<style scoped lang='scss'>
.pay-done-box {
  margin: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pay-btn {
  width: 300px;
  margin: 0 auto;
  > * {
    margin: 0 4px;
  }
}
</style>
